
/*****************************************************************************
 *
 * 作   者: 马婷婷 * 创建时间: 2020/12/15 15:40:29 *
 * Copyright (C) 2008 - 鹏业软件公司
 *
 *****************************************************************************/

import {DataPacket, NorDataList} from 'pengesoft-ng-lib';

/**
 * 培训记录
 */
export class TrainRecord extends DataPacket {
  Id: number; // 序号id
  EmpId: string; // 员工id
  TrainId: number; // 培训id
  Remark: string; // 备注

  constructor(options: {
    Id?: number;
    EmpId?: string;
    TrainId?: number;
    Remark?: string;
  } = {}) {
    super();
    this.Id = !options.Id ? 0 : Number.parseFloat(options.Id.toString());
    this.EmpId = options.EmpId || '';
    this.TrainId = !options.TrainId ? 0 : Number.parseFloat(options.TrainId.toString());
    this.Remark = options.Remark || '';
  }
}

/**
 * 培训记录列表
 */
export class TrainRecordList extends NorDataList<TrainRecord> {

  constructor(options: {
    _Items?: Array<TrainRecord>
  } = {}) {
    super();
    if (options._Items) {
      for (const item of options._Items) {
        this.append(new TrainRecord(item));
      }
    }
  }
}
